//
//  WaiQinQianDaoViewController.m
//  JuBoCRM
//
//  Created by iMac on 2024/2/3.
//  Copyright © 2024 iningKe. All rights reserved.
//

#import "WaiQinQianDaoViewController.h"
#import "ShangChuanTuPianCollectionViewCell.h"
@interface WaiQinQianDaoViewController ()<UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,UICollectionViewDataSource>
@property (weak, nonatomic) IBOutlet UICollectionView *tuPianCollectionView;
@property (weak, nonatomic) IBOutlet TPKeyboardAvoidingScrollView *mainScrollView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomSpace;
@property (weak, nonatomic) IBOutlet BRPlaceholderTextView *genJinNeiRongTextView;
@property (strong, nonatomic) IBOutletCollection(UIView) NSArray *viewArray;

@end

@implementation WaiQinQianDaoViewController





- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.customNavBar.hidden = YES;
    
    [_tuPianCollectionView registerNib:[UINib nibWithNibName:@"ShangChuanTuPianCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"ShangChuanTuPianCollectionViewCell"];
  
    if (@available(iOS 11.0, *)) {
        self.mainScrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
    
    _bottomSpace.constant = ScreenBottom+20;
    
    _genJinNeiRongTextView.placeholder = @"请输入内容";
    
    for (UIView *view in _viewArray) {
        view.layer.borderColor = [rgba(223, 223, 223, 1) CGColor];
        view.layer.borderWidth= 0.5;
    }
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 1;
}
//创建cell
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    ShangChuanTuPianCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ShangChuanTuPianCollectionViewCell" forIndexPath:indexPath];
  
    return cell;
}

//设置item的大小
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
//    return CGSizeMake(120, 86);
    return CGSizeMake((ScreenWidth-16)/3, ((ScreenWidth-16)/3-16)*78/104+16);
}
//设置垂直间距,默认的垂直和水平间距都是10
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section
{
    return 0;
}
//设置水平间距
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section
{
    return 0;
}

//四周的边距
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
    return UIEdgeInsetsMake(0, 8, 0, 8);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
